/*
    This file is part of LWX. 

    LWX is the abbreviation of the Light WiMax simulation program which 
    is a ns2 WiMAX network simulation module. LWX allows each user to 
    apply his/her designed scheduling algorithm or other mechanism used 
    in WiMAX network and generate the corresponding simulation results
    for further analysis or other non-commercial purposes.

    Copyright (C) 2008 Yen-Hung Cheng (pplong), NTUST in Taiwan, R.O.C.
    E-Mail: lwx.ns2@gmail.com

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef _LWX_ENV
#define _LWX_ENV

#include <iostream>
#include <iomanip>
#include <sstream>
#include <string>
#include <vector>
#include <math.h>
#include <time.h>
#include <fstream>
#include <queue>


using namespace std;

// frame duration definition
#define FRAME_PERIOD              0.0049
#define RTG_PERIOD                0.0001
#define PACKETS_PER_SECOND        200
#define FRAME_SYMBOL_NUM          48
#define DL_SYMBOL_NUM             36
#define UL_SYMBOL_NUM             12

#define DL_ACCESS_ZONE_SYMBOL     24
#define DL_RELAY_ZONE_SYMBOL      12
#define UL_ACCESS_ZONE_SYMBOL     6
#define UL_RELAY_ZONE_SYMBOL      6

#define DL_ACCESS_ZONE             1
#define UL_ACCESS_ZONE             2
#define DL_RELAY_ZONE              3
#define UL_RELAY_ZONE              4



#define DL_PUSC_SUBCH_NUM         60
#define UL_PUSC_SUBCH_NUM         70
#define DL_PUSC_SLOT_SYMBOL_NUM   2
#define UL_PUSC_SLOT_SYMBOL_NUM   3



// flow type definition
#define FLOW_TYPE_BS_TO_SS                  1
#define FLOW_TYPE_SS_TO_BS                  2
#define FLOW_TYPE_BS_TO_RS                  3
#define FLOW_TYPE_RS_TO_BS                  4
#define FLOW_TYPE_SS_TO_RS_TP               5
#define FLOW_TYPE_SS_TO_RS_NONTP            6
#define FLOW_TYPE_RS_TO_SS_TP               7
#define FLOW_TYPE_RS_TO_SS_NONTP            8

// node type definition
#define NODE_TYPE_BS    1
#define NODE_TYPE_SS    2
#define NODE_TYPE_RS    3

class SHOW_MSG
{
  public:
  void err_msg(string where, string msg="") const
  {
  
     cout << endl;
     cout << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl ;
     cout << endl;
     cout << "  your BWR_ELEM setting gets trouble ";
     cout << ", \n  please check your programe" << endl;
     cout << endl;
     cout << "  error code in:  " << where << endl;
     cout << "  msg:  \n         " << msg << endl;
     cout << endl;
     cout << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl ;
     cout << endl;
     exit(1);
  
  }
  
  void show_msg(string where, string msg="") const
  {
  
     cout << endl;
     cout << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl ;
     cout << endl;
     cout << "  code in:  " << where << endl;
     cout << "  msg:  \n         " << msg << endl;
     cout << endl;
     cout << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl ;
     cout << endl;
  
  }
};

#endif

